<!-- include tpl=usercp/header title=个人中心 -->
<div class="container">
	<div class="row m-3">
		<div class="col-2">
			<!-- include tpl=usercp/left -->
		</div>
		<div class="col-10">
			<div class="row mb-2">
				<div class="col-4">
					<div class="card">
						<div class="card-header">
							个人信息
							<div class="float-end"><small title="注册时间">{func date Y-m-d $me.regtime}</small></div>
						</div>
						<div class="card-body">
							<div class="d-flex justify-content-center">
								<div class="me-2"><img class="object-fit-fill border rounded-circle" src="{$me.avatar ? $me.avatar : 'assets/images/avatar.png'}" width="60px" /></div>
								<div class="ms-2">
									<div>{$me.user}</div>
									<div><span class="badge rounded-pill text-bg-danger">{$me.group_title}</span></div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="col-8">
					<div class="card">
						<div class="card-header">
							个人资产
						</div>
						<div class="card-body">
							<div class="row">
								<!-- loop from=$me.wealth key=$key value=$value id=$tmpid -->
								<a href="{url ctrl=usercp func=wealth_log id=$value.id/}" class="col text-center">
									<div class="p-2">{$value.title}</div>
									<div>{$value.val} {$value.unit}</div>
								</a>
								<!-- /loop -->
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- if $rslist -->
			<div class="card mb-2">
				<div class="card-header">
					我的订单
				</div>
				<table class="table mb-0">
				<thead>
					<tr>
						<th>订单号</th>
						<th>状态</th>
						<th>下单时间</th>
						<th>价格</th>
					</tr>
				</thead>
				<tbody>
					<!-- loop from=$rslist key=$key value=$value id=$tmpid -->
					<tr>
						<td scope="row">
							<a href="{url ctrl=order func=info id=$value.id/}">{$value.sn}</a>
						</td>
						<td>{$value.status_title}</td>
						<td>{func date "Y-m-d H:i" $value.addtime}</td>
						<td>{func price_format $value.price $value.currency_rate $value.currency_id}</td>
					</tr>
					<!-- /loop -->
				</tbody>
				</table>
			</div>
			<!-- /if -->
			<!-- if $reslist -->
			<div class="card mb-2">
				<div class="card-header">
					最新上传
				</div>
				<table class="table mb-0">
				<thead>
					<tr>
						<th>ID</th>
						<th width="70px" class="text-center">图片</th>
						<th>信息</th>
						<td>上传时间</td>
						<th width="120">操作</th>
					</tr>
				</thead>
				<tbody>
					<!-- loop from=$reslist key=$key value=$value id=$tmpid -->
					<tr>
						<td scope="row">{$value.id}</td>
						<td><img src="{$value.ico}" class="w-100" /></td>
						<td>
							<div><a href="{$value.filename}" target="_blank">{$value.title}</a></div>
							<!-- if $value.attr -->
							<div><small>
								<!-- loop from=$value.attr key=$k value=$v id=$idxx -->
								{$k}：{$v}<!-- if $idxx.num != $idxx.total -->，<!-- /if -->
								<!-- /loop -->
								</small>
							</div>
							<!-- /if -->
						</td>
						<td><small>{func time_format $value.addtime}</small></td>
						<td>
							<button type="button" onclick="$.common.res_rename('{$value.id}','{$value.title}')" class="btn btn-primary btn-sm">改名</button>
							<button type="button" onclick="$.common.res_delete('{$value.id}')" class="btn btn-danger btn-sm">删除</button>
						</td>
					</tr>
					<!-- /loop -->
				</tbody>
				</table>
			</div>
			<!-- /if -->
		</div>

	</div>
</div>
<!-- include tpl=usercp/footer -->